<template>
    <div class="container">
        <!-- 顶部栏 -->
        <div class="headerBox">
            <myNav></myNav>
        </div>
        <!-- logo区域 -->
        <myLogoArea></myLogoArea>
        <div class="content">
            <!-- 表格标题 -->
            <div class="title">
                <div class="left">
                    确认订单
                </div>
                <div class="right">
                    <img src="@/assets/imgs/orderImg.png" alt="">
                </div>
            </div>
            <!-- 商品列表 -->
            <div class="productListBox">
                <h5 class="little_title">选择寄送国家</h5>
                <div class="addressBox">
                    <input type="radio">
                    <span class="addressInfo">gowei &nbsp; +213 661 23 45 67 &nbsp; Algeria Alger alger123 &nbsp; 10
                        Didouche Mourad
                        Street</span>
                </div>

                <!-- 添加地址按钮 -->
                <div class="address-btn">
                    添加地址
                </div>

                <!-- 确认商品信息 -->
                <div class="goods-list-title">
                    <div class="little_title">确认商品信息</div>
                    <div class="line"></div>
                    <div class="return" @click="returnBuyCar">返回购物车</div>
                </div>

                <!-- 商品列表 -->
                <div class="cart-table">
                    <!-- 表头 -->
                    <div class="table-header">
                        <div class="top">
                            <div class="cell name-cell">商品名称</div>
                            <div class="cell note-cell">备注</div>
                            <div class="cell quantity-cell">数量</div>
                            <div class="cell amount-cell">商品总价</div>
                        </div>
                    </div>

                    <!-- 商品列表 -->
                    <div class="product-list">
                        <div v-for="(item, index) in items" :key="index" class="product-item">
                            <div class="top">
                                <!-- 商品详情 -->
                                <div class="cell name-cell">
                                    <div class="product-info-wrapper">
                                        <img :src="item.imageUrl" class="product-image" />
                                        <div class="product-info">
                                            <div class="product-title">{{ item.title }}</div>
                                            <div class="product-spec">{{ item.spec }}</div>
                                            <div class="product-spec_detail">{{ item.color }}</div>
                                            <div class="product-spec_detail">{{ item.size }}</div>
                                        </div>
                                    </div>
                                </div>

                                <!-- 备注 -->
                                <div class="cell note-cell">
                                    {{ item.remark || '无备注' }}
                                </div>

                                <!-- 数量 -->
                                <div class="cell quantity-cell">
                                    <el-input-number v-model="item.quantity" @change="prodectNumberCalculate(index)"
                                        :min="1" label="描述文字"></el-input-number>
                                </div>
                                <!-- 总金额 -->
                                <div class="cell amount-cell">{{ item.price * item.quantity | currency }}</div>
                            </div>

                            <!-- 底部 -->
                            <div class="bottom">
                                <div class="bottomBox">
                                    <!-- 总价 -->
                                    <div class="total-price">
                                        <div class="text">总价</div>
                                        <div class="little-price">CN￥ 333</div>
                                    </div>
                                    <!-- 国内配送费 -->
                                    <div class="domesticd-elivery-fee">
                                        <div class="text">国内运费</div>
                                        <div class="little-price">CN￥ 10</div>
                                    </div>
                                    <!-- 质检 -->
                                    <div class="qc">
                                        <div class="left">
                                            <!-- 简易质检 -->
                                            <div class="easy-qc">
                                                <div class="text"><input type="radio" name="check">
                                                    <span>简易质检(免费)</span>
                                                </div>
                                            </div>
                                            <!-- 特殊质检 -->
                                            <div class="money">
                                                <div class="special-qc">
                                                    <div class="text"><input type="radio" name="check">
                                                        <span>简易质检(中国￥30)</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="right">
                                            <div class="little-price">CN￥ 10</div>
                                        </div>
                                    </div>


                                    <!-- 优先购买 -->
                                    <div class="priority-buy">
                                        <div class="left">
                                            <div class="text">
                                                <input type="checkbox" />
                                                <span>优先购买</span>
                                            </div>
                                        </div>
                                        <div class="right">
                                            <div class="little-price">CN￥ 10</div>
                                        </div>
                                    </div>




                                </div>

                                <!-- 优先购买 -->
                                <div class="Subtotal">
                                    <div class="left">
                                        <div class="text">
                                            <span>小计</span>
                                        </div>
                                    </div>
                                    <div class="right">
                                        <div class="little-price">CN￥ 10</div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>


                </div>
            </div>
        </div>
    </div>
</template>

<script>
import myLogoArea from '@/components/myHome/myLogoArea'
import myNav from '@/components/myHome/myNav'
export default {
    name: "",
    components: {
        myLogoArea,
        myNav,
    },
    data() {
        return {
            items: [
                {
                    imageUrl: require('@/assets/imgs/4.png'),
                    title: 'Oshea stars with beaded gold dress...',
                    spec: 'Size:1/S; Color Classification:Black',
                    price: 790,
                    quantity: 2,
                    checked: false,
                    remark: ''
                },
                {
                    imageUrl: require('@/assets/imgs/6.png'),
                    title: 'Oshea stars with beaded gold dress...',
                    spec: 'Size:1/S; Color Classification:Black',
                    price: 790,
                    quantity: 2,
                    checked: false,
                    remark: ''
                },
                {
                    imageUrl: require('@/assets/imgs/5.png'),
                    title: 'Oshea stars with beaded gold dress...',
                    spec: 'Size:1/S; Color Classification:Black',
                    price: 790,
                    quantity: 2,
                    checked: false,
                    remark: ''
                },
            ]
        }
    },
    methods: {
        returnBuyCar() {
            this.$router.replace('/mybuyCar')
        }
    }
}
</script>

<style scoped lang="scss">
.container {

    .content {
        width: 90%;
        margin: 0 auto;

        // 表格标题
        .title {
            color: #00bebf;
            // float: left;
            font-size: 24px;
            line-height: 110px;
            // background-color: pink;
            display: flex;
            justify-content: space-between;

            // .left {
            //     float: left;
            // }

            // .right {
            //     float: right;
            // }
        }

        .productListBox {
            padding: 20px 20px 0;
            border: 1px solid #eee;


            // 小标题
            .little_title {
                color: #333;
                font-size: 14px;
                font-weight: 700;
                padding-bottom: 20px;
            }

            // 地址信息展示
            .addressBox {
                color: #409eff;
                font-size: 14px;
                height: 33px;
                line-height: 33px;
                display: flex;
                /* 启用flex布局 */
                align-items: center;
                /* 垂直居中 */

                .addressInfo {
                    margin-left: 8px;

                }
            }

            // 添加地址按钮
            .address-btn {
                border: 1px solid #ccc;
                box-sizing: border-box;
                color: #666;
                cursor: pointer;
                font-size: 12px;
                height: 40px;
                line-height: 38px;
                text-align: center;
                width: 120px;
                margin: 10px 0 30px 0;
            }

            // 商品列表
            .goods-list-title {
                // float: left;
                height: 1px;
                margin-top: 13px;
                width: 100%;
                display: flex;
                align-content: center;
                height: 45px;
                // line-height: 45px;
                // background-color: blue;

                // 小标题
                .little_title {
                    color: #333;
                    font-size: 14px;
                    font-weight: 700;
                    padding-bottom: 20px;
                    white-space: nowrap;
                    margin-right: 10px;
                    margin-top: 2px;
                }

                .line {
                    background-color: #00bebf;
                    height: 1px;
                    margin-top: 12.5px;
                    width: 90%;
                }

                .return {
                    border: 1px solid #00bebf;
                    border-radius: 10px;
                    color: #00bebf;
                    // float: left;
                    font-size: 12px;
                    height: 25px;
                    line-height: 25px;
                    text-align: center;
                    text-decoration: none;
                    width: 187px;
                    cursor: pointer;
                }

            }

            // 
            .cart-table {

                .product-item,
                .table-header {
                    border: 1px solid #dfdfdf;
                    margin-bottom: 25px;
                    // display: flex;
                    // align-items: center;
                    // padding: 15px 0;
                    // border-bottom: 1px solid #eee;
                    // border-top: 1px solid #eee;


                    .top {
                        display: flex;
                        align-items: center;
                        padding: 15px 0;
                        background-color: #f9f9f9;

                        .cell {
                            padding: 0 10px;
                            box-sizing: border-box;

                            &.name-cell {
                                width: 40%;
                            }

                            &.note-cell {
                                width: 25%;
                            }


                            &.quantity-cell {
                                width: 25%;
                                text-align: center;
                            }

                            &.amount-cell {
                                width: 20%;
                                text-align: center;
                            }


                        }
                    }

                    .bottom {

                        display: flex;
                        flex-direction: column;
                        align-items: end;
                        padding-top: 5px;


                        .bottomBox {
                            width: 300px;

                            // float: right;
                            // float: right;

                            // 总价
                            .total-price {
                                display: flex;

                                .text {
                                    width: 200px;
                                    text-align: right;
                                    margin-right: 20px;
                                }
                            }

                            // 国内配送费
                            .domesticd-elivery-fee {
                                display: flex;
                                padding: 5px 0;

                                .text {
                                    width: 200px;
                                    text-align: right;
                                    margin-right: 20px;
                                }
                            }

                            // 质检
                            .qc {
                                display: flex;

                                .left {
                                    width: 200px;
                                    text-align: right;
                                    margin-right: 20px;

                                    .easy-qc,
                                    .money {
                                        input {
                                            vertical-align: middle;
                                            /* 垂直居中对齐 */
                                            margin: 0;
                                            /* 去除默认外边距 */
                                        }

                                        span {
                                            /* 文字也垂直居中 */
                                            vertical-align: middle;
                                            margin-left: 5px;
                                        }
                                    }
                                }

                                .right {
                                    line-height: 36px;
                                }

                            }

                            // 优先购买
                            .priority-buy {
                                display: flex;
                                padding-bottom: 10px;
                                padding-top: 5px;

                                .left {
                                    width: 200px;
                                    text-align: right;
                                    margin-right: 20px;

                                    input {
                                        vertical-align: middle;
                                        /* 垂直居中对齐 */
                                        margin: 0;
                                        /* 去除默认外边距 */
                                    }

                                    span {
                                        vertical-align: middle;
                                        margin-left: 5px;
                                        /* 文字也垂直居中 */
                                    }
                                }
                            }


                        }

                        // 优先购买
                        // 小计
                        .Subtotal {
                            display: flex;
                            justify-content: end;
                            align-items: center;
                            height: 40px;
                            width: 100%;
                            padding: 25px 30px;
                            border-top: 1px dashed #dfdfdf;
                            .left {
                                width: 200px;
                                text-align: right;
                                margin-right: 20px;

                            }

                            .right {
                                color: #e6505f;
                                font-size: 18px;
                                font-weight: 700;

                            }
                        }
                    }
                }

                .table-header {
                    font-weight: 700;
                    border: none;
                    background-color: #fbfbfb;
                }

                // 其他运费质检计算
                .else-function {}

                .product-item {
                    .name-cell {
                        .product-info-wrapper {
                            display: flex;
                            align-items: center;

                            .product-image {
                                width: 80px;
                                height: 100px;
                                margin-right: 15px;
                                object-fit: cover;
                            }

                            .product-info {
                                .product-title {
                                    font-size: 14px;
                                    margin-bottom: 5px;
                                }

                                .product-spec {
                                    color: #666;
                                    font-size: 12px;
                                }

                                .product-spec_detail {
                                    color: #969696;
                                    font-size: 11px;
                                }
                            }
                        }
                    }

                    .quantity-cell {
                        display: flex;
                        justify-content: center;
                        align-items: center;

                        button {
                            padding: 5px 10px;
                            border: 1px solid #ddd;
                            background: white;
                            cursor: pointer;

                            &:hover {
                                background: #f5f5f5;
                            }
                        }

                        input {
                            width: 50px;
                            padding: 5px;
                            text-align: center;
                            border: 1px solid #ddd;
                            margin: 0 5px;
                        }
                    }
                }
            }
        }


    }
}
</style>